package com.wc.alorithm_blue_bridge._数学知识.规律.Q1231;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/10/29 22:47
 * @description
 */
public class Answer {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Point[] points = new Point[3];
        double[] answers = new double[n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < points.length; j++) {
                double x = sc.nextDouble();
                double y = sc.nextDouble();
                Point point = new Point(x, y);
                points[j] = point;
            }
            double ans = 0.5 * Math.abs(points[0].x * points[1].y +
                    points[1].x * points[2].y +
                    points[2].x * points[0].y -
                    points[0].x * points[2].y -
                    points[1].x * points[0].y -
                    points[2].x * points[1].y);
            answers[i] = ans;
        }
        for (double ans : answers) {
            System.out.printf("%.2f\n", ans);
        }
        sc.close();
    }

    static class Point {
        public Point(double x, double y) {
            this.x = x;
            this.y = y;
        }

        double x;
        double y;
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }
    }
}
